
*** FIGURE 2**** 

*** Your path here

cd ....

use "cross.dta", clear

keep F5_12 F1_1_kat ptv_sd 

gen rile=F5_12
gen age_cat=F1_1_kat
tab ptv_sd
tab rile


gen sd_potential=.
replace sd_potential=1 if rile<5 | ptv_sd>5
replace sd_potential=0 if rile>=5 & ptv_sd<=5
tab sd_potential

gen sd_potential_4cats=0 if rile>=5 & ptv_sd<=5
replace sd_potential_4cats=2 if rile<5 & ptv_sd<=5
replace sd_potential_4cats=3 if rile>=5 & ptv_sd>5
replace sd_potential_4cats=4 if rile<5 & ptv_sd>5

tab sd_potential_4cats



graph twoway (scatter  ptv_sd rile if (ptv_sd>5 | rile<5), mcolor(red) jitter(5) msize(vtiny) ) (scatter  ptv_sd rile if rile>=5 &ptv_sd<=5, mcolor(black) jitter(5) msize(vtiny)),  aspectratio(1) ytitle("PTV: Social Democrats") xtitle(Left-Right ideology) xline(4.5, lpattern(dash)) yline(5.5, lpattern(dash)) text(5.5 11.5 "{bf:PTV threshold}", size(small)) text(10.3 4.5 "{bf:Ideological threshold}", size(small)) legend(off) scheme(plotplain) text(2.5 2.5 "{bf:16%}", size(small)) text(7.5 2.5 "{bf:21%}", size(small)) text(7.5 7.5 "{bf:16%}", size(small)) text(2.5 7.5 "{bf:46%}", size(small))

graph export "Figure2.pdf", as(pdf) replace

graph export "Figure2.jpg", as(jpg) replace


graph export "Figure2.tif", as(tif) width(2000) replace
